/*************************************************
Author: will
Date: 10/23/2012
Description:
Notes: 
*************************************************/

#ifndef __CRoleConfigMgr_h__
#define __CRoleConfigMgr_h__

#include "CLevelUpConfig.h"
#include "CRoleInitCfg.h"
#include "CRoleAttrCfg.h"
#include "CAlchemyConfig.h"

class CPlayerBaseInfo;
class CPlayerDetailInfo;
class CRoleConfigMgr
{
public:
	CRoleConfigMgr() 
    {
	}

	virtual ~CRoleConfigMgr() 
    {
	}

    int LoadConfig(const char* sConfigFile);

    int AddLevelUpExp(unsigned char ucLevel, unsigned int uiLevelExp)
    {
        return _stLevelUpConfig.AddLevelUpExp(ucLevel, uiLevelExp);
    }

    int GetLevelUpExp(unsigned char ucLevel, unsigned int& uiLevelExp)
    {
        return _stLevelUpConfig.GetLevelUpExp(ucLevel, uiLevelExp);
    }

    int GetTotalExp(unsigned char ucLevel, uint64& u64TotalExp)
    {
        return _stLevelUpConfig.GetTotalExp(ucLevel, u64TotalExp);
    }

    int AddRoleInitCfg(CRoleInitCfgData& stCfgData)
    {
        return _stRoleInitCfg.AddConfig(stCfgData);
    }

    int FindRoleInitCfg(unsigned int uiID)
    {
        return _stRoleInitCfg.FindConfig(uiID);
    }

	CRoleInitCfgData& GetRoleInitCfg(int iIndex)
	{
	    return _stRoleInitCfg.GetConfig(iIndex);
	}

    int FindRoleAttrCfg(int iID)
    {
        return _stRoleAttrCfg.FindConfig(iID);
    }

	CRoleAttrCfgData& GetRoleAttrCfg(int iIndex)
	{
	    return _stRoleAttrCfg.GetConfig(iIndex);
	}

    int GetAlchemySilver(unsigned short usLevel, unsigned int& uiSilver)
    {
        return _stAlchemyConfig.GetConfig(usLevel, uiSilver);  
    }

private:
	CRoleInitCfg 		_stRoleInitCfg;
    CRoleAttrCfg        _stRoleAttrCfg;
	CLevelUpConfig 		_stLevelUpConfig;
    CAlchemyConfig      _stAlchemyConfig;
};

#endif // __CRoleConfigMgr_h__

